/**
 * File  : Event.h
 * Time  : 2014-12-17 14:39
 * Author: KashingLee
 * Ref   : mooon
 */
#ifndef PLCC_THREAD_EVENT_H_
#define PLCC_THREAD_EVENT_H_
#include <pthread.h>
#include <stdint.h>
#include "Mutex.h"

class Event {
 public:
  Event();
  ~Event();

  void Wait(Mutex& mutex);
  void TimeWait(Mutex& mutex, uint32_t seconds);
  void Signal();
  void Broadcast();
 
 private:
  pthread_condattr_t attr_;
  pthread_cond_t     event_;
};
#endif //PLCC_THREAD_EVENT_H_
